# -*- coding:utf-8 -*-
# created by jinss

import smtplib
from email.mime.text import MIMEText # 邮件正文
from email.header import Header  # 邮件头

# 登录

smtp_obj = smtplib.SMTP_SSL("smtp.qq.com", 465)
# smtp_obj.login("ssjin198909@163.com", "CHTFQLNSRITRTHOQ")
smtp_obj.login("782705318@qq.com", "gerxlatjpmrbbfja")
# 显示调试信息
smtp_obj.set_debuglevel(1)

# 设置邮件头信息
mail_body = '''
    <h5>hello,小哥哥</h5>
    <p>
        小哥哥，约么？800，新到学生妹.. <a href="http://wx1.sinaimg.cn/mw1024/5ff6135fgy1gdnghz2vbsg205k09ob2d.gif"> 这是我的照片</a></p>
    </p>
'''

msg = MIMEText(mail_body, "html", "utf-8")
msg["From"] = Header("金大师","utf-8") # 发送者
msg["To"] = Header("金大师的小号","utf-8") # 接收者
msg["Subject"] = Header("python发送邮件实践","utf-8") # 主题

# 发邮件

smtp_obj.sendmail("782705318@qq.com", ["3197184328@qq.com", "782705318@qq.com"],msg.as_string())